classic_battlefield_moddingfandomcom-20200214-history
Converting Bundledmesh to Staticmesh
Based on info provided by 1/2Hawk, Coronaextra and mschoeldgenXww2 This is a short tutorial on converting a bundledmesh to a staticmesh. A staticmesh is for objects that don't move. A bundledmesh is used for objects that have movement where players would interact with it. One example of the need to convert a bundledmesh to a static is to use a vehicle a non moveable obstacle or if you want a large vehicle to be able to navmeshed so bots can move around on it. The big issue is that the different mesh types use textures differenly. Converting from bundledmesh -> staticmesh is easier than the other way around, as you can load the bundledmesh texture into the Color slot of the staticmesh shader and get most of it correct. The main problem there (which you may not care about) is that you have no detail texture to carry specular information in its alpha channel - so the object might turn out really freaking shiny. Bundlemeshes only have a single UV channel and a single Diffuse and normal texture. Exporting it to StaticMesh as is will mean it is using BASE technique and will not shade or look like most statics. Generally it is much brighter because there is no Detail layer to multiply with the color layer. To fix this I would move the Color UV set (channel 1) to the Detail UV set (channel 2) and then find a suitable color texture for it. Even a flat 127 gray would work. The conveted static is not lightmapped and probably doesn't have a proper lightmap UV channel anyway. Therefore it is much brighter than the surrounding objects. A flat mapped UV set in channel 5 with some Lightmap samples should allow you to Lightmap the object in the editor. Aside: A way to quickly turn it down on the whole thing is to make a tiny 4x4 pixel image, colored 50% grey, add an alpha channel and color that however shiny you want the model (black is matte), save as whateveryouwant_de.dds as a DXT5 image and load that in the Detail texture slot. You need to flatten map the uvws on channel 2 after this step below if you do this though. You need to have all the bits and pieces in a legitimate hierarchy (check here: http://bfeditor.org/forums/index.php?showtopic=5013), which should include the LODs you deleted and definitely have collision meshes made for it. The tools youre using dont import col meshes, you have to make them yourself. OK - the reason you got an empty folder is because your object has too many channels assigned to it. A lot of times, importing BF2 objects will give you 5 channels - where you can only have 1 on the col meshes and however many on the static meshes. For this case, thats 1:map for the old bundlemesh texture in the Color slot, and 2:map if you use the shiny texture fix in the Detail slot. So how do you fix it? Go into your Utilities tab (top right, 5th little tabby thing) - choose More - and find a utility called Channel Info. Run that and it will put a button on that menu in the right with the same name. Click that and go select any mesh. It will show you what maps are part of the mesh. Choose #5, hit Clear, choose #4, hit Clear, etc etc until you have the right number. Now go back to the modifier stack for that mesh and you'll see that it just added a bunch of Clear UVW Mapping modifiers. Right click and Collapse All in the stack before exporting. Do this for all meshes, and when you export - it will work. Also, In case you still have children parented to the main mesh , you should either attach them to the main mesh to export the static as 'SimpleObject' (which is the default ) or make the main mesh a 'Bundle' by appending the '__Bundle' string to the name of the main mesh. Only a 'bundle' static may have children meshes.